package com.sunb2b.entity;

import java.util.*;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.util.AutoPopulatingList;
import org.springframework.web.multipart.MultipartFile;

/**
 * Product entity. @author MyEclipse Persistence Tools
 */

public class Product {

    // Fields

    private Integer id;
    private Member member;
    private Integer memberId;
    @Length(min=3, max=30, message="请先选择类别")
    private String categoryId;
    
    private Category category;
    
    private Date dateCreated;
    
    private String sDateCreated;
    
    private Date endDate;
    @Length(min=3, max=50, message="长度必须在3-50之间")
    private String name;
    @Length(min=3, max=30, message="请选择区域")
    private String regionId;
    private Region region;
    private String unit;
    //@Min(value = 0, message="价格必须大于0")
    @Length(min=1, max=30, message="请输入正确的价格")
    private String price;
    @Length(max=65000, message="长度超过了65000")
    private String description;
    
    private String iconImage;
    private MultipartFile iconImageFile;
    private MultipartFile  bigImageFile;
    
    private String bigImage;
    private String status;
    
    private String validCode;
    
    private String promoteIndicator;
    
    private List productDetails = new AutoPopulatingList(ProductDetail.class);

    // Constructors

    /** default constructor */
    public Product() {
    }

    // Property accessors

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Member getMember() {
        return this.member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    public String getCategoryId() {
        return this.categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public Date getDateCreated() {
        return this.dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public Date getEndDate() {
        return this.endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRegionId() {
        return this.regionId;
    }

    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }

    public String getUnit() {
        return this.unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getPrice() {
        return this.price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getIconImage() {
        return this.iconImage;
    }

    public void setIconImage(String iconImage) {
        this.iconImage = iconImage;
    }

    public String getBigImage() {
        return this.bigImage;
    }

    public void setBigImage(String bigImage) {
        this.bigImage = bigImage;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List getProductDetails() {
        return this.productDetails;
    }

    public void setProductDetails(List productDetails) {
        this.productDetails = productDetails;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Region getRegion() {
        return region;
    }

    public void setRegion(Region region) {
        this.region = region;
    }

    public MultipartFile getIconImageFile() {
        return iconImageFile;
    }

    public void setIconImageFile(MultipartFile iconImageFile) {
        this.iconImageFile = iconImageFile;
    }

    public MultipartFile getBigImageFile() {
        return bigImageFile;
    }

    public void setBigImageFile(MultipartFile bigImageFile) {
        this.bigImageFile = bigImageFile;
    }

    public String getsDateCreated() {
        return sDateCreated;
    }

    public void setsDateCreated(String sDateCreated) {
        this.sDateCreated = sDateCreated;
    }

	public Integer getMemberId() {
		return memberId;
	}

	public void setMemberId(Integer memberId) {
		this.memberId = memberId;
	}

	public String getValidCode() {
		return validCode;
	}

	public void setValidCode(String validCode) {
		this.validCode = validCode;
	}

	public String getPromoteIndicator() {
		return promoteIndicator;
	}

	public void setPromoteIndicator(String promoteIndicator) {
		this.promoteIndicator = promoteIndicator;
	}
	
}
